#ifndef IMAGEPROVIDER_H
#define IMAGEPROVIDER_H
#include <QQuickImageProvider>
#include <QMap>
#include <QPixmap>
#include <QString>

class ImageProvider : public QQuickImageProvider
{
    Q_OBJECT
public:
    static ImageProvider& instance();

    QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override;

    void insertPixmap(QPixmap&& pixmap);

    QImage getImage();
signals:

private:
    explicit ImageProvider();

private:
    // QMap<QString, QPixmap> img_map_;
    QPixmap img_;

};

#endif // IMAGEPROVIDER_H
